package com.xiaozhen.common.core.domain.device;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaozhen.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * HISTORY
 *
 * @author zhenweisheng
 * @date 2021/11/1 11:16
 * @description:
 */
@Data
@TableName("device_category")
@ApiModel(description = "设备分类")
public class DeviceCategory extends BaseEntity {

    @TableId
    @ApiModelProperty(value = "分类ID")
    private Long categoryId;

    @ApiModelProperty(value = "分类名")
    private String categoryName;

    @ApiModelProperty(value = "父级ID")
    private Long parentId;

    @TableLogic
    @ApiModelProperty(value = "删除标志（0代表存在 1代表删除）")
    private String delFlag;

    @ApiModelProperty(value = "子分类")
    @TableField(exist = false)
    private List<DeviceCategory> children = new ArrayList<>();
}
